package gc;

/**
 * 循环引用
 */
public class CycleDependency {
    private byte[] bytes = new byte[1024 * 1024 * 2]; // 2M
    private CycleDependency in;

    public static void main(String[] args) {
        CycleDependency c1 = new CycleDependency();
        CycleDependency c2 = new CycleDependency();
        c1.in = c2;
        c2.in = c1;
        c1 = null;
        c2 = null;
        System.gc();
    }
}
